Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #8662/be23d16f backport][3.10] Improve performance of keepalive rescheduling #8670

Conversation

patchback[bot]
Copy link
Contributor

@patchback patchback bot commented Aug 9, 2024

This is a backport of PR #8662 as merged into master (be23d16).

What do these changes do?

If not all handlers were done, the keep alive would get rescheduled every second until the current time was greater than self._keepalive_time + self._keepalive_timeout

Instead we will reschedule the timer for the expected keep alive close time if the timer handle fires too early.

Are there changes in behavior for the user?

no

Is it a substantial burden for the maintainers to support this?

no

related issue #8613

Before we would see 1 timer handle created every second for 60s per connection. After we get 1 timer handle total for when the keepalive timeout is due.

before
before

after
after

after_take_2

@bdraco bdraco enabled auto-merge (squash) August 9, 2024 17:07
Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.71%. Comparing base (dbcdb16) to head (72e6368).
Report is 198 commits behind head on 3.10.

Additional details and impacted files
@@           Coverage Diff           @@
##             3.10    #8670   +/-   ##
=======================================
  Coverage   97.71%   97.71%           
=======================================
  Files         108      108           
  Lines       33981    33984    +3     
  Branches     4047     4047           
=======================================
+ Hits        33205    33208    +3     
  Misses        579      579           
  Partials      197      197           
Flag Coverage Δ
CI-GHA 97.61% <100.00%> (+<0.01%) ⬆️
OS-Linux 97.28% <75.00%> (-0.01%) ⬇️
OS-Windows 94.81% <100.00%> (+<0.01%) ⬆️
OS-macOS 96.96% <75.00%> (-0.01%) ⬇️
Py-3.10.11 97.05% <100.00%> (+<0.01%) ⬆️
Py-3.10.14 97.00% <75.00%> (-0.01%) ⬇️
Py-3.11.9 97.24% <100.00%> (+<0.01%) ⬆️
Py-3.12.4 97.34% <100.00%> (+<0.01%) ⬆️
Py-3.8.10 94.42% <100.00%> (+<0.01%) ⬆️
Py-3.8.18 96.79% <75.00%> (-0.01%) ⬇️
Py-3.9.13 96.94% <100.00%> (+<0.01%) ⬆️
Py-3.9.19 96.79% <75.00%> (-0.11%) ⬇️
Py-pypy7.3.16 96.48% <75.00%> (-0.01%) ⬇️
VM-macos 96.96% <75.00%> (-0.01%) ⬇️
VM-ubuntu 97.28% <75.00%> (-0.01%) ⬇️
VM-windows 94.81% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bdraco bdraco merged commit f96182a into 3.10 Aug 9, 2024
32 of 33 checks passed
@bdraco bdraco deleted the patchback/backports/3.10/be23d16fa95e77516b7199d9b0ae8a08e8c941f4/pr-8662 branch August 9, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant